/*
 * @Description:枚举类的测试类
 * 
 * @Author: rendc
 * 
 * @Date: 2025-08-08 16:27:06
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-08-08 17:05:49
 */
public class Test {

  public static void main(String[] args) {
    // 实例化枚举类的对象
    Gender gender1 = Gender.MALE;
    Gender gender2 = Gender.FEMALE;
    System.out.println(gender1);
    System.out.println(gender2);
    // 实例化枚举类的对象
    // Gender gender3 = Gender.BOY;
    // 枚举对象的取值 只能是枚举元素
    // 枚举类中声明了几个 就只有几个
    Gender gender3 = Gender.MALE;
    Gender gender4 = Gender.FEMALE;
    System.out.println(gender3);
    System.out.println(gender4);
    // js
    // console.log();
    System.out.println("--==--==--");
    Week week1 = Week.MON;
    Week week2 = Week.TUE;
    Week week3 = Week.SUN;
    System.out.println(week1);
    System.out.println(week1.toString());
    System.out.println(week1.name());
    // 获取枚举元素的编号
    System.out.println(week1.ordinal()); // 0
    System.out.println(week2.ordinal()); // 1
    System.out.println(week3.ordinal()); // 6
    Week week4 = Week.THU;
    System.out.println(week4.getDesc());
    week4.setDesc("no");
    System.out.println(week4.getDesc());
    week4.show();
  }
}